home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 614 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: dispatch.news.demon.net!demon!polo!john
  2. From: john@polo.demon.co.uk (John Winters)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Prefixing functions with return type..
  5. Date: Wed, 20 Mar 1996 17:26:36 GMT
  6. Organization: Wallingford
  7. Message-ID: <DoKtsD.5M7@polo.demon.co.uk>
  8. References: <4hstf8$jf3@cybernews.cyberus.ca> <1996Mar14.080731.15076@Watt.COM> <1996Mar18.201616.6958@watt.com>
  9. X-NNTP-Posting-Host: polo.demon.co.uk
  10.  
  11. In article <1996Mar18.201616.6958@watt.com>,
  12. Adrian P Stephens  <aps@symbionics.co.uk> wrote:
  13. [snip]
  14. >Our standards also require explicit
  15. >identification of the size returned if it is an integer.   This is of 
  16. >benefit if you are doing emulation/debugging without a symbolic emulator/
  17. >debugger (and how many do that??),   but otherwise doesn't allow you to
  18. >pretend you've got "opaque types" in "C".   Also,  for some things where
  19. >the type is not selected until compile time (e.g. integer sizes and 
  20. >size_t particularly) you cannot select a name which is legal in the
  21. >sense of these standards.
  22. >
  23. >Here's an example from a bit of code I'm working on now:
  24. >
  25. >extern TX_MANAGEMENT_PKT * psTxManagementPktTXP_NewTxBeaconPkt(void);
  26.  
  27. Aaaargh!  All those wishing to avoid working for this company,
  28. please form an orderly queue.  Don't push.
  29.  
  30. >
  31. >Elements required in our standard:
  32. >
  33. >   TX_MANAGEMENT_PKT  - all upper case because it's a typedef/struct
  34. >   p                  - pointer to ...
  35. >   sTxManagementPkt   - a structure of this type (but case converted)
  36. >   TXP                - name of module containing global export
  37. >   "NewTxBeaconPkt"   - What I orginally called the routine before
  38. >                      - I read our coding standards.
  39. >
  40. >
  41. >Oh,  and finally another example from real code:
  42. >
  43. >/*--------------------------------------------------------------------------
  44. > * Routine:     u32GetU32
  45. > *
  46. > * Parameters: Name         r/w     Usage
  47. > *              char **     *w      ppcParams
  48. > *                                  
  49. > * Returns:    u32 value
  50. > *
  51. > * Description:
  52. > *      Read and return a u32 value from the command-line,  reading decimal
  53. > *      numbers by default,  or hex if preceded by "0x".
  54. > *--------------------------------------------------------------------------*/
  55. >extern u32 u32GetU32(char ** ppcParams);
  56. >
  57. >Which,  I guess,  answers "<<++>>" above.
  58.  
  59. Which I guess is as damning a condemnation of Hungarian notation as
  60. you're going to get.
  61.  
  62. John
  63.  
  64. -- 
  65. John Winters.  Wallingford, Oxon, England.
  66.